<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="member-item">
    <image class="member-item-img" :src="info.avatar_url" mode="aspectFill" />
    <view class="member-item-user" v-if="info.is_main === 1">
      <image
        class="member-item-user2"
        src="@/package/guider/static/detail-member-user.png"
      />主理人
    </view>
    <view class="member-item-desc">{{ info.good_at }}</view>
    <view class="member-item-content">
      <view style="display: flex; align-items: center">
        <view class="member-item-name">{{ info.guider_name }}</view>
        <view class="member-item-score">
          {{ info.score }}<text class="member-item-score2">分</text>
        </view>
      </view>
      <view class="member-item-tag">
        <view class="member-item-tag2" v-for="i of info.tag_arr" :key="i">
          {{ i }}
        </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss">
.member-item {
  position: relative;
  border-radius: 20rpx;
  background-color: #ffffff;
  box-shadow: 0 4rpx 20rpx 0 rgba(34, 34, 34, 0.05);

  .member-item-img {
    display: block;
    width: 100%;
    height: 336rpx;
    border-radius: 20rpx 20rpx 0 0;
  }

  .member-item-user {
    position: absolute;
    left: 10rpx;
    top: 10rpx;
    display: flex;
    align-items: center;
    height: 30rpx;
    padding-left: 10rpx;
    padding-right: 6rpx;
    font-size: 22rpx;
    color: #b2903a;
    background-color: #fff9b6;
    border-radius: 8rpx;
  }

  .member-item-user2 {
    width: 20rpx;
    height: 22rpx;
    margin-right: 12rpx;
  }

  .member-item-desc {
    position: absolute;
    left: 10rpx;
    top: 278rpx;
    padding: 0 20rpx;
    font-size: 22rpx;
    color: #ffffff;
    line-height: 48rpx;
    white-space: nowrap;
    border-radius: 10rpx;
    background-color: rgba(21, 21, 21, 0.63);
    backdrop-filter: blur(20rpx);
  }

  .member-item-content {
    padding: 20rpx;
  }

  .member-item-name {
    min-width: 0;
    font-size: 28rpx;
    color: #2d2d2d;
    line-height: 40rpx;
    font-weight: bold;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .member-item-score {
    flex-shrink: 0;
    margin-left: 10rpx;
    font-size: 28rpx;
    color: #ff7900;
    line-height: 40rpx;
    font-weight: bold;
  }

  .member-item-score2 {
    margin-left: 2rpx;
    font-size: 24rpx;
    line-height: 34rpx;
    font-weight: 400;
  }

  .member-item-tag {
    display: flex;
    margin-top: 10rpx;
    overflow: hidden;
  }

  .member-item-tag2 {
    flex-shrink: 0;
    padding: 0 8rpx;
    margin-right: 10rpx;
    font-size: 22rpx;
    color: #4e9b93;
    line-height: 28rpx;
    border-radius: 8rpx;
    border: 2rpx solid rgba(78, 155, 147, 0.2);
  }
}
</style>
